import { defineStore } from 'pinia'
const useGameStore = defineStore('game', {
  state: () => {
    return {
      searchKeys: [],
      gameList: [],
      isMore: true,
      currentGameType: {}
    }
  },
  actions: {
    setState(params) {
      for (let key in params) {
        this[key] = params[key]
      }
    }
  },
  // persist: true // 默认本地localstorage
  persist: {
    key: 'game',
    paths: ['searchKeys', 'currentGameType'] // 空数组是都不存储，null或undefined时为存储所有，填写值时存储当前值
  }
})

export default useGameStore
